package com.mw.wmimobile.commons;

import android.app.Dialog;
import android.content.Context;
import android.os.Bundle;
import android.view.Window;
import android.widget.TextView;

import com.wm.wmimobile.R;

public class LoadingDialog extends Dialog {

	private String message;
	private TextView textView;

	public LoadingDialog(Context context, String message) {
		super(context);
		this.message = message;
	}

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.dialog_loading);
		textView = (TextView) findViewById(R.id.dialogLoadMessage);
		setText(message);
		this.setCancelable(false);
	}
	
	public void setText(String message) {
		textView.setText(message);
	}
	
	public void setTextId(int id) {
		textView.setText(getContext().getResources().getString(id));
	}

}
